<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>主轴垂直方向对齐</title>
</head>
<body>
    <style>
    .y{
        display: flex;
        flex-direction: column;
        justify-content: flex-start;   /*左对齐（默认）*/
        justify-content: end;          /*右对齐*/
        justify-content: center;       /*居中对齐*/
        justify-content: space-between;/*两端对齐*/
        justify-content: space-around; /*环绕对齐*/
        justify-content: space-evenly; /*均匀分布对齐*/
        width: 500px;
        height: 500px;
        background-color: aqua;
        margin: 10px;
    }
    .y span{
        width: 100px;
        height: 100px;
        background-color: red;
        margin: 20px;
        text-align:center;
    }
    </style>
    <p class="y">
        <span>1</span>
        <span>2</span>
    </p>
</body>
</html>